package UIComponents
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	/** 
	 * @author thy
	 * @version 1.0.0 
	 * 创建时间：Apr 24, 2012 4:17:35 PM 
	 * QQ黄钻每日礼包页面
	 */ 
	public class QQVipDayGift extends Sprite
	{
		private var lqBtn:DisplayObject;
		private var closeBtn:DisplayObject;
		
		public function QQVipDayGift()
		{
			init();
		}
		
		private function init():void
		{
			closeBtn=this.getChildByName("closeBtn");
			this.lqBtn=this.getChildByName("lqBtn");
			this.lqBtn.addEventListener(MouseEvent.CLICK,lqFun);
			this.closeBtn.addEventListener(MouseEvent.CLICK,onClick);
		}
		
		private function onClick(e:MouseEvent):void
		{
			this.dispatchEvent(new PanelEvent(PanelEvent.CLOSE,true));
		}
		
		private function lqFun(e:MouseEvent):void
		{
			this.dispatchEvent(new PanelEvent(PanelEvent.CUSTOMCALLBACK,true));
		}
		
		public function contrlLqBtn(flag:Boolean=true):void
		{
			this.lqBtn.visible=	flag;
		}
		
		public function controlView(isyear:Boolean,lv:int,dayArr:Array,yearObj:Object,nextArr:Array):void
		{
			this.getChildByName("nhpanel").visible=isyear;
			this.getChildByName("hzpanel").visible=!isyear;
			if(isyear)
			{
				(this.getChildByName("nhpanel") as YearDayGift).setDataInfo(lv,dayArr,yearObj,nextArr);
			}else{
				(this.getChildByName("hzpanel") as CommHzDayGift).setDataInfo(lv,dayArr,yearObj,nextArr);
			}
		}
		
	}
}
